package com.wxy.ej.flow.modules.act.listen;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Slf4j
@Component("appNoticeTaskListener")
@Scope("prototype")
public class AppNoticeTaskListener implements JavaDelegate {

    //重写委托的提交方法
    @Override
    public void execute(DelegateExecution execution) {
        log.info("---->act listener: AppNoticeTaskListener");

        /*long ctcTaskId = Long.parseLong(execution.getProcessInstanceBusinessKey());
        Result<CtcTaskBizDto> result = ctcTaskBizService.selectById(ctcTaskId);
        CtcTaskBizDto ctcTaskBizDto = result.getObj();
        System.out.println("AppNoticeTaskListener:ctcTaskId:"+ctcTaskId);
        List<Map> userList = (List<Map>)execution.getVariableLocal("userList");
        if (userList==null) {
            userList = (List<Map>)execution.getVariable("userList");
        }
        for (Map userMap: userList) {
            String userId = (String)userMap.get("userId");
            String userName = (String)userMap.get("userName");
            System.out.println("AppNoticeTaskListener:"+userName);
            cityTaskAutoService.sendMsg(Long.parseLong(userId), userName, ctcTaskBizDto.getTaskContent(), "任务编号："+ctcTaskBizDto.getTaskNumber()+"; 任务内容："+ctcTaskBizDto.getTaskContent(), ""+ctcTaskId, "", 1);
        }*/
    }


}
